home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act8 / 00097.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  2.2 KB  |  66 lines

  1. on mouseUp
  2.   global cx, cy, nextclick, hord, mainlist, donelist, lastClick, nextchan, complete
  3.   if (count(donelist) > 0) and (getPos(donelist, the clickOn) = count(donelist)) then
  4.     set the ink of sprite the clickOn to 36
  5.     set nextclick to nextclick - 1
  6.     if count(donelist) > 0 then
  7.       deleteAt(donelist, count(donelist))
  8.       set lastClick to getAt(donelist, count(donelist))
  9.       set nextchan to getAt(hordlink, lastClick - 1)
  10.     else
  11.       set donelist to []
  12.       set lastClick to 0
  13.       set nextchan to [1]
  14.     end if
  15.     exit
  16.   end if
  17.   if getPos(nextchan, the clickOn - 1) = 0 then
  18.     repeat with xxx = 1 to count(nextchan)
  19.       set the blend of sprite (getAt(nextchan, xxx) + 1) to 50
  20.     end repeat
  21.     startTimer()
  22.     repeat while the timer < 60
  23.       updateStage()
  24.     end repeat
  25.     repeat with xxx = 1 to count(nextchan)
  26.       set the blend of sprite (getAt(nextchan, xxx) + 1) to 100
  27.     end repeat
  28.   else
  29.     if getAt(hord, the clickOn - 1) > 0 then
  30.       if (getAt(mainlist, nextclick) = getAt(mainlist, abs(getAt(hord, the clickOn - 1)))) and (getPos(donelist, the clickOn) = 0) then
  31.         set lastClick to the clickOn
  32.         set nextclick to nextclick + 1
  33.         set the ink of sprite the clickOn to 4
  34.         set nextchan to getAt(hordlink, lastClick - 1)
  35.         add(donelist, the clickOn)
  36.         updateStage()
  37.       else
  38.         puppetSprite(1, 1)
  39.         puppetSprite(25, 1)
  40.         set mycnum to the castNum of sprite 25
  41.         set the castNum of sprite 25 to the number of cast "correct3"
  42.         play frame "mistake" & random(3)
  43.         set the castNum of sprite 25 to mycnum
  44.         puppetSprite(25, 0)
  45.       end if
  46.     else
  47.       puppetSprite(1, 1)
  48.       puppetSprite(25, 1)
  49.       set mycnum to the castNum of sprite 25
  50.       set the castNum of sprite 25 to the number of cast "correct3"
  51.       play frame "mistake" & random(3)
  52.       set the castNum of sprite 25 to mycnum
  53.       puppetSprite(25, 0)
  54.     end if
  55.     if (nextclick > 10) and getAt(donelist, count(donelist)) then
  56.       puppetSprite(25, 0)
  57.       puppetSprite(1, 1)
  58.       play frame complete
  59.       repeat with xxx = 2 to 48
  60.         puppetSprite(xxx, 0)
  61.       end repeat
  62.       go("begin")
  63.     end if
  64.   end if
  65. end
  66.